﻿@* @model ZR.CodeGenerator.Model.GenerateDto; *@
@{
    var genTable = Model.GenTable;
    var subTableOptions = Model.SubTableOptions;
    var options = Model.GenOptions;
    var replaceDto = Model.ReplaceDto;
}
import request from '@@/utils/request'

/**
* @(genTable.FunctionName)分页查询
* @@param {查询条件} data
*/
export function list@(genTable.FunctionCode)(query) {
  return request({
    url: '/@(genTable.ModuleCode)/@(genTable.FunctionCode)/list',
    method: 'get',
    data: query,
  })
}

@if(replaceDto.ShowBtnAdd)
{
@:/**
@:* 新增@(genTable.FunctionName)
@:* @@param data
@:*/
@:export function add@(genTable.FunctionCode)(data) {
  @:return request({
    @:url: '/@(genTable.ModuleCode)/@(genTable.FunctionCode)',
    @:method: 'post',
    @:data: data,
  @:})
@:}
}
@if(replaceDto.ShowBtnEdit)
{
@:/**
@:* 修改@(genTable.FunctionName)
@:* @@param data
@:*/
@:export function update@(genTable.FunctionCode)(data) {
  @:return request({
    @:url: '/@(genTable.ModuleCode)/@(genTable.FunctionCode)',
    @:method: 'PUT',
    @:data: data,
  @:})
@:}
}
/**
* 获取@(genTable.FunctionName)详情
* @@param {Id}
*/
export function get@(genTable.FunctionCode)(id) {
  return request({
    url: '/@(genTable.ModuleCode)/@(genTable.FunctionCode)/' + id,
    method: 'get'
  })
}

@if(replaceDto.ShowBtnDelete || replaceDto.ShowBtnMultiDel)
{
@:/**
@:* 删除@(genTable.FunctionName)
@:* @@param {主键} pid
@:*/
@:export function del@(genTable.FunctionCode)(pid) {
  @:return request({
    @:url: '/@(genTable.ModuleCode)/@(genTable.FunctionCode)/delete/' + pid,
    @:method: 'delete'
  @:})
@:}
}